package think.thread.sychron.c02.toast;

public class ToastButter implements Runnable{

	private ToastQueue dry,butter;
	
	public ToastButter(ToastQueue dry,ToastQueue butter){
		this.dry=dry;
		this.butter=butter;
	}
	
	public void run() {
		try {
			
			while(!Thread.interrupted()){
				Toast toast=dry.take();
				toast.butter();
				System.out.println(toast);
				butter.put(toast);
			}
			
		} catch (Exception e) {
			System.out.println("exit via interrupted...");
		}
	}

}
